<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>{:session('cp.cpsysname')}--商户管理平台</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
    <meta name="description" content="{:config('webconfig.description');}">
    <meta name="keywords" content="{:config('webconfig.keywords');}">
    <meta name="author" content="runoob">
    <link rel="stylesheet" href="__STATIC_URL__/static/css/bootstrap.css">
    <link rel="stylesheet" type="text/css" href="__STATIC_URL__/static/css/index.css"/>
    <link rel="stylesheet" type="text/css" href="__STATIC_URL__/static/css/bootstrap-datetimepicker.css"/>
    <script src="__STATIC_URL__/static/js/jquery-2.1.4.min.js"></script>
    <script src="__STATIC_URL__/static/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <script src="__STATIC_URL__/static/js/commen.js" type="text/javascript" charset="utf-8"></script>
    <script src="__STATIC_URL__/static/js/bootstrap-datetimepicker.js" type="text/javascript" charset="utf-8"></script>
    <link rel="stylesheet" type="text/css" href="__STATIC_URL__/static/bootstrap-table/bootstrap-table.css"/>
    <script src="__STATIC_URL__/static/bootstrap-table/bootstrap-table.js"></script>
    <script src="__STATIC_URL__/static/bootstrap-table/bootstrap-table-zh-CN.js"></script>
    <script src="__STATIC_URL__/static/layer/3.0.3/layer.js"></script>

    <style>
        thead tr th {
            text-align: center;
        }

        thead tr th:nth-child(1) {
            text-align: left;
        }

        tbody tr td {
            text-align: center;
        }

        tbody tr td:nth-child(1) {
            text-align: left;
        }
    </style>
    <style>
        .info-row{
            line-height: 32px;
            color: #333;
        }
        .info-row label{
            padding-left: 15px;
            padding-right: 15px;
            font-weight: 400;
        }
        td a{
            color: #337ab7;
        }
        .layui-laydate {

            z-index: 6666666 !important;

        }
    </style>
</head>
<body>
{include file='public/header'/}
<section id="content">
    <!------------------导航-------------------------->
    {include file='public/left'/}
    <!--------------------------主要内容区域------------------------------------->
    <div class="content">
        <div class="page-heading mgl15 mgr15">
            <ol class="breadcrumb">
                <li>当前位置是&nbsp;:</li>
                <li><a href="{:url('cards/cardslist')}">卡券管理</a></li>
                <li>
                    <a href="javascript:history.back();">卡券统计</a>
                </li>
                <li class="active" style="color: #02b87f;"> 卡券核销明细</li>
            </ol>
        </div>
        <div class="panel panel-default panel-search mgl15 mgr15">
            <div class="panel-heading">
                <h3 class="panel-title">
                    <span class="glyphicon glyphicon-search pull-left" style="margin-right: 10px;"></span>条件查找
                </h3>
            </div>
            <div class="panel-body">
                <form action="" method="get" class="form-horizontal table-search form-search" role="form" id="machform">
                    <div class="col-sm-6 col-md-6 col-lg-4 ">
                        <div class="form-group">
                            <label class="col-sm-3 control-label">核销门店：</label>
                            <div class="col-sm-9">
                                <select name="mid" class="form-control" id="mach">
                                    {if condition="get_mid_num() neq '1'"}
                                    <option value="">所有门店</option>
                                    {/if}
                                    {volist name='mach' id='mid'}
                                    <option value="{$mid['id']}">{$mid.merchant}</option>
                                    {/volist}
                                </select>
                            </div>
                        </div>
                    </div>
                    <div class="col-sm-6 col-md-6 col-lg-4 ">
                        <div class="form-group">
                            <label class="col-sm-3 control-label">卡券code：</label>
                            <div class="col-sm-9">
                                <input type="text" class="form-control" placeholder="请输入卡号" name="code" value="" id="code">
                                <input type="hidden" class="form-control" placeholder="请输入卡号" name="card_id" value="{$card['card_id']}" id="card_id">
                            </div>
                        </div>
                    </div>
                    <div class="col-sm-6 col-md-6 col-lg-4 ">
                        <div class="form-group">
                            <label class="col-sm-3 control-label">核销员：</label>
                            <div class="col-sm-9">
                                <input type="text" class="form-control" placeholder="请输入核销员" name="con_username" value="" id="con_username">
                            </div>
                        </div>
                    </div>
                    <div class="col-sm-6 col-md-6 col-lg-4">
                        <div class="form-group">
                            <label class="col-sm-3 control-label">核销时间：</label>
                            <div class="col-sm-9">
                                <div class="input-group">
                                    <div class="">
                                        <input name="search_date" type="text" value="" readonly="readonly"
                                               id="search_date" placeholder="请选择日期" class="form-control" id="search_date">
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
            <div class="panel-footer">
                <a href="javascript:;" class="btn btn-primary" onclick="searchform()">查找</a>
                <a href="javascript:;" class="btn btn-default" onclick="clearform()">清空</a>
            </div>


        </div>

        <div class="panel mgl15 mgr15">
            <div class="panel-heading addCharts" style="background:#ededed;">交易明细</div>
            <div class="panel-body">
                <table class="table table-bordered" id="tablelist">


                </table>
            </div>

        </div>

        {include file='public/footer'/}
    </div>

</section>
<script src="__STATIC_URL__/static/laydate/laydate.js"></script>
<script src="/wntables.js"></script>

<script>
    function searchform() {
        $("#tablelist" ).bootstrapTable('refresh');
    }
    $(function () {
        var type = "reportcardgenerallist";
        var url = "{:url()}";
        getcolumn(type, url, "tablelist")
    });
    laydate.render({
        elem: '#search_date',
        type: 'date',
        range: true,
        ready: function(date){
            lay.extend(followuptime.config.dateTime, {
                hours: 23
                ,minutes: 59
                ,seconds: 59
            });
        },
        change: function (value, date, date2, data3) {
            var s = value.split(" - ");
            var startdate = new Date(s[0]).getTime();
            var enddate = new Date(s[1]).getTime();
            var ldate = Math.floor((enddate - startdate) / (24 * 3600 * 1000));
            if (ldate > 31) {
                layer.alert("日期区间不能大于31天");
                $("#search_date").val("");
            }
        }
    });
</script>
</body>
</html>
